home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / dseeker.zip / DSEEKER.PAS < prev   
Pascal/Delphi Source File  |  1986-07-08  |  2KB  |  69 lines

  1. program dseeker;
  2.  
  3.  const
  4.       alarmtime=25; {number of milliseconds to sound alarm tone}
  5.       alarmfreq=440; {alarm sound frequency, approx. 440 Hz}
  6.  
  7.  type
  8.       regpack = record
  9.        ax,bx,cx,dx,bp,si,di,ds,es,flags:integer;
  10.       end;
  11.  var
  12.      drive,head,track,strtsec,numsec,veresult:integer;chb:char;stb:string[80];
  13.      biospack,savpack:regpack;
  14.  
  15.  begin
  16.  
  17.   repeat
  18.    clrscr;
  19.    writeln('Disk Seek/Verify/Align Utility');writeln;
  20.    write('Drive (0-3) ? ');readln(drive);
  21.    write('Head (0-1) ? ');readln(head);
  22.    write('Track (0-39) ? ');readln(track);
  23.    write('Starting sector (1-9) ? ');readln(strtsec);
  24.    write('Number of sectors to verify (max = 8 or 9 - start sector + 1) ? ');
  25.    readln(numsec);
  26.    biospack.ax := (4 shl 8) or numsec; { verify code in ah, numsec in al }
  27.    biospack.bx := 0; { dummy offset for verify }
  28.    biospack.cx := (track shl 8) or 1; { track in ch, start sector in cl }
  29.    biospack.dx := (head shl 8) or lo(drive); { head in dh, drive in dl }
  30.    biospack.es := 0; { dummy segment addr for verify }
  31.    writeln;
  32.    writeln('Ready, strike any key to start or stop ... ');
  33.    savpack := biospack;
  34.    repeat
  35.    ;
  36.    until keypressed;
  37.    read(kbd); { dummy read }
  38.    repeat
  39.     intr($13,biospack); { diskette i/o call }
  40.     gotoxy(1,12);clreol;
  41.     veresult := hi(biospack.ax);
  42.     case veresult of
  43.      0:stb:='No error';
  44.      1:stb:='Bad command to BIOS--s.n.o.';
  45.      2:stb:='Bad addr mark';
  46.      3:stb:='Write protected--s.n.o.';
  47.      4:stb:='Record not found';
  48.      8:stb:='DMA overrun';
  49.      9:stb:='DMA across a 64K boundary';
  50.      16:stb:='Bad CRC';
  51.      32:stb:='NEC controller failure';
  52.      64:stb:='Bad seek';
  53.      128:stb:='Time out';
  54.      else stb:='Unknown error';
  55.     end;
  56.     writeln('Verify status = ',veresult,' (',stb,')');
  57.     if veresult <> 0 then sound(alarmfreq);
  58.     delay(alarmtime);
  59.     nosound;
  60.     delay(500-alarmtime); {do the verify about once a second}
  61.     biospack := savpack;
  62.    until keypressed;
  63.    writeln;
  64.    read(kbd);
  65.    write('Repeat (Y/N) ? ');readln(stb);
  66.    chb := stb[1];
  67.   until (chb='N') or (chb='n');
  68.   clrscr;
  69.  end.